<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<title>知云硬件管理云平台|@yield('title')</title>
<link rel="stylesheet" type="text/css" href="{{ asset('/css/bootstrap/bootstrap.min.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('/css/libs/font-awesome.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('/css/libs/nanoscroller.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('/css/compiled/theme_styles.css') }}"/>
<link rel="stylesheet" href="{{ asset('/css/libs/fullcalendar.css') }}" type="text/css"/>
<link rel="stylesheet" href="{{ asset('/css/compiled/calendar.css') }}" type="text/css" media="screen"/>
<link rel="stylesheet" href="{{ asset('/css/libs/morris.css') }}" type="text/css"/>
<link rel="stylesheet" href="{{ asset('/css/libs/daterangepicker.css') }}" type="text/css"/>
<link rel="stylesheet" href="{{ asset('/css/libs/nifty-component.css') }}" type="text/css"/>
<link rel="stylesheet" href="{{ asset('/css/libs/select2.css') }}" type="text/css"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/libs/ns-default.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/libs/ns-style-growl.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/libs/ns-style-other.css') }}"/>
<link rel="stylesheet" type="text/css" href="{{ asset('css/libs/ns-style-theme.css') }}"/>

@yield('css')

<link type="image/x-icon" href="{ asset('/favicon.png') }}" rel="shortcut icon"/>
<style>
    .col-sm-1{
        outline: 1px solid #fff;
        /*border-radius: 10px;*/
        cursor: pointer;
    }
</style>
<link href='//fonts.useso.com/css?family=Open+Sans:400,600,700,300|Titillium+Web:200,300,400' rel='stylesheet' type='text/css'>
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>
<![endif]-->
</head>
<body class="theme-turquoise">
<div id="theme-wrapper">
    <header class="navbar" id="header-navbar">
    <div class="container">
        <a href="{{ action('AdminController@index') }}" id="logo" class="navbar-brand">
        <!-- <img src="{{ asset('/img/logo.png') }}" alt="" class="normal-logo logo-white"/>
        <img src="{{ asset('/img/logo-black.png') }}" alt="" class="normal-logo logo-black"/>
        <img src="{{ asset('/img/logo-small.png') }}" alt="" class="small-logo hidden-xs hidden-sm hidden"/> -->
        知云硬件管理云平台
        </a>
        <div class="clearfix">
            <div class="nav-no-collapse navbar-left pull-left hidden-sm hidden-xs">
                <ul class="nav navbar-nav pull-left">
                    <li>
                    <a class="btn" id="make-small-nav">
                    <i class="fa fa-bars"></i>
                    </a>
                    </li>
                </ul>
            </div>
            <div class="nav-no-collapse pull-right" id="header-nav">
                <ul class="nav navbar-nav pull-right">
                    <li class="mobile-search">
                    <a class="btn">
                    <i class="fa fa-search"></i>
                    </a>
                    <div class="drowdown-search">
                        <form role="search">
                            <div class="form-group">
                                <input type="text" class="form-control" id="search-phone" placeholder="请输入要搜索的手机号...">
                                <button id="check-search"><i class="fa fa-search nav-search-icon"></i></button>
                            </div>
                        </form>
                    </div>
                    </li>
                    </li>
                    <li class="dropdown profile-dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                    <img src="{{ asset('/img/qr2.png') }}" alt=""/>
                    <span class="hidden-xs">{{ isset($nickname)?$nickname:'' }}</span><b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li><a href="#" class="md-trigger" data-modal="modal-user"><i class="fa fa-user"></i>个人信息</a></li>
                        <li><a href="#" class="md-trigger" data-modal="modal-pwd"><i class="fa fa-key"></i>密码修改</a></li>
                        <li><a href="#"><i class="fa fa-cog"></i>设置</a></li>
                    </ul>
                    </li>
                    <li class="hidden-xxs">
                    <a class="btn" href="{{ action('AdminController@logout') }}">
                        <i class="fa fa-power-off"></i>
                    </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    </header>
    <div id="page-wrapper" class="container">
        <div class="row">
            <div id="nav-col">
                <section id="col-left" class="col-left-nano">
                <div id="col-left-inner" class="col-left-nano-content">
                    <div id="user-left-box" class="clearfix hidden-sm hidden-xs">
                        <img alt="" src="{{ asset('/img/qr.png') }}"/>
                        <div class="user-box">
                            <span class="name">
                                欢迎！
                            <br/>
                                {{ isset($nickname)?$nickname:'' }}
                            </span>
                            <span class="status">
                            <i class="fa fa-circle"></i> 当前在线
                            </span>
                        </div>
                    </div>
                    <div class="collapse navbar-collapse navbar-ex1-collapse" id="sidebar-nav">
                        <ul class="nav nav-pills nav-stacked">
                            <li class="active">
                            <a href="{{ action('AdminController@index') }}">
                            <i class="fa fa-dashboard"></i>
                            <span>监控面板</span>
                            </a>
                            </li>
                            <li class="open active">
                            <a href="#" class="dropdown-toggle">
                            <i class="fa fa-codepen"></i>
                            <span>设备管理</span>
                            <i class="fa fa-chevron-circle-right drop-icon"></i>
                            </a>
                            <ul class="submenu">
                                <li id="deviceInfo">
                                <a href="{{ action('DeviceController@info') }}">
                                    设备信息查询
                                </a>
                                </li>
                                <li id="deviceEdit">
                                <a href="{{ action('DeviceController@edit') }}">
                                    设备信息修改
                                </a>
                                </li>
                                <li id="deviceBind">
                                <a href="{{ action('DeviceController@bind') }}">
                                    设备发放
                                </a>
                                </li>
                                <li id="">
                                    <a href="{{ URL::to('deviceRepair') }}">
                                        设备返修
                                    </a>
                                </li>
                                <li id="">
                                    <a href="{{ URL::to('deviceRepairs') }}">
                                        设备返修列表
                                    </a>
                                </li>
                            </ul>
                            </li>
                            <li class="open active">
                            <a href="#" class="dropdown-toggle">
                            <i class="fa fa-users"></i>
                            <span>小区管理</span>
                            <i class="fa fa-chevron-circle-right drop-icon"></i>
                            </a>
                            <ul class="submenu">
                                <li id="groupArrange">
                                <a href="{{ action('GroupController@arrange') }}">
                                    小区管理
                                </a>
                                </li>
                                <li id="groupCreate">
                                <a href="{{ action('GroupController@create') }}">
                                    小区创建
                                </a>
                                </li>
                                <li id="groupSetting">
                                <a href="{{ action('GroupController@setting') }}">
                                    小区设定
                                </a>
                                </li>
                            </ul>
                            </li>
                            <?php isset($is_created)?$is_created:$is_created = \Session::get('is_created'); ?>
                            @if( !empty($is_created) && isset($is_created) )
                            <li class="open active">
                            <a href="#" class="dropdown-toggle">
                            <i class="fa fa-user"></i>
                            <span>代理商管理</span>
                            <i class="fa fa-chevron-circle-right drop-icon"></i>
                            </a>
                            <ul class="submenu">
                                <li id="groupArrange">
                                <a href="{{ action('AdminController@agents') }}">
                                    代理商管理
                                </a>
                                </li>
                            </ul>
                            </li>
                            @endif
                        </ul>
                    </div>
                </div>
                </section>
            </div>
            <div id="content-wrapper">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="row">
                            <div class="col-lg-12">
                                <ol class="breadcrumb">
                                    <li><a href="{{ action('AdminController@index') }}">首页</a></li>
                                    @yield('pre')
                                </ol>
                                <h1>@yield('title')</h1>
                            </div>
                        </div>
                            <button id="notic" class="btn btn-primary progress-button mrg-b-lg" style="display: none">
                                
                            </button>
                        @yield('content')

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="md-modal md-effect-11" id="modal-pwd">
    <div class="md-content">
        <div class="modal-header">
            <button class="md-close close">&times;</button>
            <h4 class="modal-title">密码修改</h4>
        </div>
        <div class="modal-body">
            <form role="form" method="post" action="{{ url('userEdit') . '/2' }}">
                <div class="form-group">
                    <label for="oldPwd">旧密码</label>
                    <input type="password" class="form-control" id="oldPwd" name="oldPwd" placeholder="请输入旧密码">
                </div>
                <div class="form-group">
                    <label for="newPwd1">新密码</label>
                    <input type="password" class="form-control" id="newPwd1" name="newPwd[]" placeholder="请输入新密码">
                </div>
                <div class="form-group">
                    <label for="newPwd2">重复新密码</label>
                    <input type="password" class="form-control" id="newPwd2" name="newPwd[]" placeholder="请重复输入新密码">
                </div>
                <div class="form-group" style="text-align: center">
                    <input type="submit" class="btn btn-primary btn-xs" name="edit" value="修改">
                </div>
            </form>
        </div>
    </div>
</div>


<div class="md-modal md-effect-11" id="modal-user">
    <div class="md-content">
        <div class="modal-header">
            <button class="md-close close">&times;</button>
            <h4 class="modal-title">个人设置</h4>
        </div>
        <div class="modal-body">
            <form role="form" method="post" action="{{ url('userEdit') . '/1' }}">
                <div class="form-group col-lg-12">
                        <label for="nickname" class="col-lg-2 control-label" style="margin-left:-10px;">昵称</label>
                        <div class="col-lg-5">
                            <input class="form-control" id="nickname" name="nickname" type="text" placeholder="请输入昵称" value="{{ isset($nickname)?$nickname:'' }}">
                        </div>
                    </div>
                <div class="form-group">
                    <label for="newPwd1" class="col-lg-2 control-label">省份</label>
                    <select id="loc_province" name="province">
                    </select>
                </div>
                <div class="form-group">
                    <label for="newPwd2" class="col-lg-2 control-label">市区</label>
                    <select id="loc_city" name="city">
                    </select>
                </div>
                <div class="form-group" style="text-align: center">
                    <input type="submit" class="btn btn-primary btn-xs" name="edit" value="修改">
                </div>
            </form>
        </div>
    </div>
</div>
<footer id="footer-bar" class="row fixed-footer">
    <p id="footer-copyright" class="col-xs-12">
        &copy; 2015 
        <a href="http://www.zhiyee.com/" target="_blank">Zhiyee</a>.
    </p>
</footer>
<script src="{{ asset('/js/jquery.js') }}"></script>
<script src="{{ asset('/js/bootstrap.js') }}"></script>
<script src="{{ asset('/js/demo.js') }}"></script>
<script src="{{ asset('/js/jquery-ui.custom.min.js') }}"></script>
<script src="{{ asset('/js/jquery.slimscroll.min.js') }}"></script>
<script src="{{ asset('/js/morris.min.js') }}"></script>
<script src="{{ asset('/js/moment.min.js') }}"></script>
<script src="{{ asset('/js/daterangepicker.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.min.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.time.min.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.pie.min.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.stack.min.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.resize.min.js') }}"></script>
<script src="{{ asset('/js/flot/jquery.flot.threshold.js') }}"></script>
<script src="{{ asset('/js/modernizr.custom.js') }}"></script>
<script src="{{ asset('/js/classie.js') }}"></script>
<script src="{{ asset('/js/notificationFx.js') }}"></script>
<script src="{{ asset('/js/modalEffects.js') }}"></script>


<script src="{{ asset('/js/location/area.js') }}"></script>
<script src="{{ asset('/js/location/location.js') }}"></script>

<script src="{{ asset('/js/select2.min.js') }}"></script>
<script src="{{ asset('/js/select2_locale_zh-CN.js') }}"></script>

<script src="{{ asset('/js/scripts.js') }}"></script>
<script src="{{ asset('/js/pace.min.js') }}"></script>

@yield('js')

<script type="text/javascript">

    //菜单active
    $(document).ready(function(){
        
        var uri = window.location.href;

        $('.submenu > li').each(function(){

            var id = $(this).attr('id');

            if( uri.indexOf(id) != -1 )
            {
                $("#" + id).addClass('active');
            }
            // else
            // {
            //     $("#" + id).addClass('active');
            // }
        
        });

        $('.md-trigger').click(function(){

            setTimeout(function(){

                $('.md-modal').addClass('sh-modal');

            }, 500);

        });

        $('.md-close').click(function(){

            setTimeout(function(){

                $('.md-modal').removeClass('sh-modal');

            }, 500);

        });

        var provinecVal = "{{ isset($province)?$province:'' }}";
        var cityVal = "{{ isset($city)?$city:'' }}";

        if(provinecVal != '' && cityVal != '')
        {
            //省份设置
            $('#loc_province').val(provinecVal).trigger("change");
            //市区设置
            $('#loc_city').val(cityVal).trigger("change");
        }

        //提示
        // $("#notic").on( 'click', function() {

        //     // create the notification
        //     var notification = new NotificationFx({
        //         message : '<p>Hello there! I\'m a classic notification but I have some elastic jelliness thanks to <a href="http://bouncejs.com/">bounce.js</a>. </p>',
        //         layout : 'growl',
        //         effect : 'jelly',
        //         type : 'error', // notice, warning, error or success
        //         onClose : function() {
                    
        //         }
        //     });

        //     // show the notification
        //     notification.show();
            
        // } );

        $error = '{{ isset($error)?$error:0 }}';
        $notic = '{{ isset($msg)?$msg:"" }}';
       
        if($notic != '')
        {
            if($error == 1)
            {
                var notification = new NotificationFx({
                    message : '<span class="fa fa-exclamation-triangle fa-3x pull-left"></span><p><h4>错误</h4>' + $notic + '</p>',
                    layout : 'growl',
                    effect : 'jelly',
                    type : 'error', // notice, warning, error or success
                    onClose : function() {
                        
                    }
                });
            }
            else
            {
                var notification = new NotificationFx({
                    message : '<span class="fa fa-exclamation-triangle fa-3x pull-left"></span><p><h4>成功</h4>' + $notic + '</p>',
                    layout : 'growl',
                    effect : 'jelly',
                    type : 'success', // notice, warning, error or success
                    onClose : function() {
                        
                    }
                });
            }

            notification.show();
        }
    });

    //搜索手机号
    $('#check-search').on('click', function(){
        
        var uri = "{{ url('deviceEdit') }}";
        
        window.location.href = uri + '?phoneNum=' + $('#search-phone').val();

    })
           

</script>
</body>
</html>